package product;

public class Demo {
    public static void main(String[] args) {
        OrderProcessor orderProcessor = new OrderProcessor();
        Product product = new Product("12345", "java book", 10);

        orderProcessor.addProduct(product);
        try {
            orderProcessor.processOrder("12345", 2);
            orderProcessor.processOrder("12345", 9);
        } catch (Exception e) {
            System.out.println("处理订单时出错:" + e.getMessage());
        }
    }
}
